package com.kgame5.xtank3d.control {
import kgame5.enginex.GameCommand;
import kgame5.k3d.util3d.Shaker;
import kgame5.kutil.T;

import com.kgame5.xtank3d.GameEnum;
import com.kgame5.xtank3d.effect.Eff3DManager;
import com.kgame5.xtank3d.vo.BlastVO;
import com.kgame5.xtank3d.vo.ShotVO;

/**
 * @author kk
 */
public class ShotBlastCommand extends GameCommand{
	public static const NAME:String="ShotBlastCommand";

	override public function execute(data:Object) : void {
		T.p(NAME);
		
		//
		var shotVO:ShotVO=data as ShotVO;
		
		//删除实体
		gamePlay.removeEntity(shotVO.id);
		
		//爆炸动画
		var blastVO:BlastVO=new BlastVO();
		blastVO.type=GameEnum.BLAST_TYPE_NORMAL;
		blastVO.posi= shotVO.hardVO.v3d_p.clone();
		blastVO.posi.y=32;
		blastVO.WAVE= shotVO.blastRange;
		//粒子特效
		Eff3DManager.getInstance().blast(blastVO);
		//屏幕震动
		Shaker.getInstance().start(3, 2);
		//连锁爆炸
		this.sendCommand(BlastChainCommand.NAME, blastVO);
	}
}//end of class
}